package puzzlebn;

import aima.search.framework.StepCostFunction;

public class PuzzleBNStepCostFunction implements StepCostFunction{

	@Override
	public Double calculateStepCost(Object fromState, Object toState,
			String action) {
		
		PuzzleBNEstado estadoOriginal = (PuzzleBNEstado) fromState;
		PuzzleBNEstado estadoDestino = (PuzzleBNEstado) toState;
		
		return (double) Math.abs(estadoOriginal.getPosicionHueco() - estadoDestino.getPosicionHueco());
	}

}
